package com.itwn.comic.mapper;

import com.itwn.comic.entity.Permission;
import com.itwn.comic.vo.PermissionVo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface PermissionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Permission record);

    Permission selectByPrimaryKey(Long id);

    List<Permission> selectAll();

    int updateByPrimaryKey(Permission record);
    
    List<PermissionVo> initLoadAllPermission();

    List<PermissionVo> selectPermissionByName(String name);

    @Select("select p.id,p.name from t_permission p where p.parent_id=0")
    List<PermissionVo> selectAllByParentMenu();

    List<Integer> selectMenuByRole(int id);

    List<PermissionVo> selectPermissionByUserId(long id);
}